import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
//引入弹性盒子样式
import './assets/css/flexbox.css'
//引入element-ui框架
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(ElementUI)
//引入Fragment布局
import Fragment from 'vue-fragment'
Vue.use(Fragment.Plugin)
//引入axios HTTP库
import axios from 'axios'
Vue.prototype.$http = axios

Vue.config.productionTip = false

router.beforeEach((to, from, next) => {
  //to 即将进入的路由
  //from 即将离开的路由
  //设置选项卡数据
  store.commit('getTabs');
  //设置当前激活的选项卡
  store.commit('setActiveTabs', to.name);
  //继续往下运行
  next();
})

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
